<template>
	<view class="compose_order">
		<Navbar>订单详情</Navbar>
		<scroll-view scroll-y class="scroll_view">
			<view class="status">
				<view class="icon">合成成功</view>
			</view>
			<view class="tips">商品已转入您的个人中心，请查看</view>
			<view class="banner">
				<view class="cover_box">
					<view class="cover">
						<image :src="cover"></image>
					</view>
					<view class="view_box">
						<view class="name">{{name}}</view>
						<view class="number" v-if="number">#{{number}}</view>
					</view>
				</view>
				<view class="sub_title">
					<image :src="`${baseImageUrl}/home/xs.png`"></image>
					<text>订单详情</text>
				</view>
				<view class="one">
					<view class="item">订单编号：{{order_no}}</view>
				</view>
				<view class="one two">
					<view class="item">合成成功，商品转入中</view>
					<view class="item">商品转入成功（{{created_at}})</view>
				</view>
				<view class="btn_view">
					<view class="cancel" @click="redirectRouter(0)">继续合成</view>
					<view class="confirm" @click="redirectRouter(0)">返回大厅</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import {
		orderInfo
	} from '@/request/api.js';
	export default {
		data() {
			return {
				id: null,
				cover: "",
				name: "",
				number: "",
				order_no: "",
				created_at: "",
			}
		},
		async onLoad(option) {
			this.id = option.id;
			let {
				info
			} = await orderInfo({
				id: this.id
			});
			this.cover = info.product.cover;
			this.name = info.product.name;
			this.number = info.product_number;
			this.order_no = info.order_no;
			this.created_at = info.created_at;
		},
	}
</script>

<style scoped lang="scss">
	.compose_order {
		height: 100vh;
		background: #29170D;
		overflow: hidden;

		.scroll_view {
			height: calc(100vh - #{$navbarHeight});

			.status {
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;

				.icon {
					width: 240rpx;
					height: 240rpx;
					color: #38880F;
					font-size: 40rpx;
					font-weight: 400;
					font-family: LiSu;
					display: flex;
					justify-content: center;
					align-items: flex-end;
					background: url(#{$baseImageUrl}/common/success.png) no-repeat;

					background-size: 100% 100%;
				}
			}

			.tips {
				text-align: center;
				color: #FFFFFF;
				font-size: 28rpx;
				font-weight: 400;
				font-family: SimSun;
				margin: 20rpx 0 68rpx;
			}

			.banner {
				width: 100%;
				height: 800rpx;
				padding: 32rpx 75rpx 80rpx;
				box-sizing: border-box;
				background: url(#{$baseImageUrl}/bg/750_800.png) no-repeat;

				background-size: 100% 100%;

				.cover_box {
					display: flex;

					.cover {
						width: 200rpx;
						height: 200rpx;
						border-radius: 10rpx;
						padding: 4rpx;
						box-sizing: border-box;
						background: #C0B5B6;
						overflow: hidden;

						image {
							width: 100%;
							height: 100%;
						}
					}

					.view_box {
						flex: 1;
						padding: 20rpx 30rpx;
						box-sizing: border-box;
						overflow: hidden;

						.name {
							color: #494338;
							font-size: 50rpx;
							font-weight: 400;
							font-family: LiSu;
						}

						.number {
							color: #494338;
							font-weight: 400;
							font-size: 40rpx;
							font-family: LiSu;
							margin-top: 40rpx;
						}
					}
				}
			}

			.sub_title {
				margin: 40rpx 0;
				display: flex;
				align-items: center;

				image {
					width: 32rpx;
					height: 32rpx;
				}

				text {
					line-height: 32rpx;
					color: #494338;
					font-size: 32rpx;
					font-weight: 400;
					font-family: SimSun;
					padding-left: 12rpx;
					box-sizing: border-box;
				}
			}

			.one {
				border-bottom: 1px solid rgba(73, 67, 56, .2);
				padding-bottom: 10rpx;

				.item {
					color: #494338;
					font-size: 32rpx;
					font-weight: 400;
					font-family: SimSun;
					margin-bottom: 20rpx;
				}

				&.two {
					padding-top: 30rpx;
					border: none;
				}
			}

			.btn_view {
				width: 100%;
				margin-top: 50rpx;
				display: flex;
				justify-content: center;

				view {
					width: 210rpx;
					height: 80rpx;
					line-height: 80rpx;
					text-align: center;
					color: #FFFFFF;
					font-size: 30rpx;
					font-weight: 400;
					margin: 0 35rpx;
				}

				.cancel {
					background: url(#{$baseImageUrl}/common/btn3.png) no-repeat;
					background-size: 100% 100%;
				}

				.confirm {
					background: url(#{$baseImageUrl}/common/btn.png) no-repeat;
					background-size: 100% 100%;
				}
			}
		}
	}
</style>